$OpenBSD: patch-randnum_c,v 1.4 2015/02/09 18:56:11 jasper Exp $
--- randnum.c.orig	Tue Oct 28 02:55:43 2014
+++ randnum.c	Mon Feb  9 19:24:58 2015
@@ -16,8 +16,18 @@
 #include <fcntl.h>
 #include <errno.h>
 
+#include "config.h"
 #include "pwgen.h"
 
+#ifdef HAVE_ARC4RANDOM
+
+int pw_random_number(int max_num)
+{
+	return (arc4random_uniform(max_num));
+}
+
+#else
+
 #ifdef HAVE_DRAND48
 extern double drand48(void);
 #endif
@@ -76,3 +86,4 @@ int pw_random_number(max_num)
 	fprintf(stderr, "No entropy available!\n");
 	exit(1);
 }
+#endif	/* HAVE_ARC4RANDOM */
